var server = "http://106.75.137.2:8088/lenong"

function getQueryString(thisUrl,name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	var r1 = thisUrl.toString().split("?")[1];
	if(r1 != null){
		var r = r1.match(reg);
		if (r != null) return unescape(r[2]);
	}
	return null;

}

$.paySubmit = function(){
	$.ajax({
		type : "GET",
		//access_token的获取请参考wxLogin获取用户信息.orderId参数为订单的ID
		url : server+"/chargeCreate?access_token=k3r5l1ilmb5ul3bq6w1eupiktftft1dy6hs5svxomb6ulvzbi3v5Bzdj&orderId=1&callback=?",
		dataType : "jsonp",
		jsonp: 'callback',
		success : function(json){
			console.log(json);
			pingpp.createPayment(json.pingxxCharge, function(result, err) {
				if(result == "success"){
					console.log("支付成功");
					//执行业务逻辑
				}else if (result == "fail") {
					console.log("支付失败");
				}else if (result == "cancel") {
					console.log("用户取消");
				}
			});
		}
	});


}

$.paySubmit();